﻿using System;

namespace SharpSqlAnalyzer.nodes
{
	// Token: 0x02000336 RID: 822
	public class TPivotClause : TNodeWithAliasClause
	{
		// Token: 0x170006D8 RID: 1752
		// (get) Token: 0x060021A6 RID: 8614 RVA: 0x00334080 File Offset: 0x00332280
		// (set) Token: 0x060021A7 RID: 8615 RVA: 0x00334088 File Offset: 0x00332288
		public virtual TPivotInClause PivotInClause
		{
			get
			{
				return this.pivotInClause;
			}
			set
			{
				this.pivotInClause = value;
			}
		}

		// Token: 0x170006D9 RID: 1753
		// (get) Token: 0x060021A8 RID: 8616 RVA: 0x00334091 File Offset: 0x00332291
		// (set) Token: 0x060021A9 RID: 8617 RVA: 0x00334099 File Offset: 0x00332299
		public virtual TUnpivotInClause UnpivotInClause
		{
			get
			{
				return this.unpivotInClause;
			}
			set
			{
				this.unpivotInClause = value;
			}
		}

		// Token: 0x170006DA RID: 1754
		// (get) Token: 0x060021AA RID: 8618 RVA: 0x003340A2 File Offset: 0x003322A2
		// (set) Token: 0x060021AB RID: 8619 RVA: 0x003340AA File Offset: 0x003322AA
		public virtual TObjectNameList PivotColumnList
		{
			get
			{
				return this.pivotColumnList;
			}
			set
			{
				this.pivotColumnList = value;
			}
		}

		// Token: 0x170006DB RID: 1755
		// (get) Token: 0x060021AC RID: 8620 RVA: 0x003340B3 File Offset: 0x003322B3
		public virtual TResultColumnList In_result_list
		{
			get
			{
				return this.in_result_list;
			}
		}

		// Token: 0x170006DC RID: 1756
		// (get) Token: 0x060021AD RID: 8621 RVA: 0x003340BB File Offset: 0x003322BB
		// (set) Token: 0x060021AE RID: 8622 RVA: 0x003340C3 File Offset: 0x003322C3
		public virtual TResultColumnList Aggregation_function_list
		{
			get
			{
				return this.aggregation_function_list;
			}
			set
			{
				this.aggregation_function_list = value;
			}
		}

		// Token: 0x170006DD RID: 1757
		// (get) Token: 0x060021B0 RID: 8624 RVA: 0x003340D5 File Offset: 0x003322D5
		// (set) Token: 0x060021AF RID: 8623 RVA: 0x003340CC File Offset: 0x003322CC
		public virtual int Type
		{
			get
			{
				return this.type;
			}
			set
			{
				this.type = value;
			}
		}

		// Token: 0x170006DE RID: 1758
		// (get) Token: 0x060021B1 RID: 8625 RVA: 0x003340DD File Offset: 0x003322DD
		// (set) Token: 0x060021B2 RID: 8626 RVA: 0x003340E5 File Offset: 0x003322E5
		public virtual TObjectNameList ValueColumnList
		{
			get
			{
				return this.valueColumnList;
			}
			set
			{
				this.valueColumnList = value;
			}
		}

		// Token: 0x170006DF RID: 1759
		// (get) Token: 0x060021B3 RID: 8627 RVA: 0x003340EE File Offset: 0x003322EE
		// (set) Token: 0x060021B4 RID: 8628 RVA: 0x003340F6 File Offset: 0x003322F6
		public virtual TFunctionCall Aggregation_function
		{
			get
			{
				return this.aggregation_function;
			}
			set
			{
				this.aggregation_function = value;
			}
		}

		// Token: 0x170006E0 RID: 1760
		// (get) Token: 0x060021B5 RID: 8629 RVA: 0x003340FF File Offset: 0x003322FF
		// (set) Token: 0x060021B6 RID: 8630 RVA: 0x00334107 File Offset: 0x00332307
		public virtual TObjectNameList ColumnList
		{
			get
			{
				return this.columnList;
			}
			set
			{
				this.columnList = value;
			}
		}

		// Token: 0x170006E1 RID: 1761
		// (get) Token: 0x060021B7 RID: 8631 RVA: 0x00334110 File Offset: 0x00332310
		public virtual TObjectName PivotColumn
		{
			get
			{
				return this.pivotColumn;
			}
		}

		// Token: 0x170006E2 RID: 1762
		// (get) Token: 0x060021B8 RID: 8632 RVA: 0x00334118 File Offset: 0x00332318
		[Obsolete("use ValueColumnList instead")]
		public virtual TObjectName ValueColumn
		{
			get
			{
				return this.valueColumn;
			}
		}

		// Token: 0x060021B9 RID: 8633 RVA: 0x00334120 File Offset: 0x00332320
		public override void init(object arg1, object arg2)
		{
			if (arg1 is TFunctionCall)
			{
				this.aggregation_function = (TFunctionCall)arg1;
			}
			else if (arg1 is TResultColumnList)
			{
				this.aggregation_function_list = (TResultColumnList)arg1;
			}
			else if (arg1 is TObjectNameList)
			{
				this.valueColumnList = (TObjectNameList)arg1;
			}
			else if (arg1 is TObjectName)
			{
				this.valueColumn = (TObjectName)arg1;
			}
			if (arg2 is TObjectName)
			{
				this.pivotColumn = (TObjectName)arg2;
				return;
			}
			if (arg2 is TObjectNameList)
			{
				this.pivotColumnList = (TObjectNameList)arg2;
			}
		}

		// Token: 0x060021BA RID: 8634 RVA: 0x003341AC File Offset: 0x003323AC
		public override void init(object arg1, object arg2, object arg3)
		{
			this.init(arg1, arg2);
			if (arg3 is TUnpivotInClause)
			{
				this.unpivotInClause = (TUnpivotInClause)arg3;
				return;
			}
			if (arg3 is TPivotInClause)
			{
				this.pivotInClause = (TPivotInClause)arg3;
			}
		}

		// Token: 0x060021BB RID: 8635 RVA: 0x003341E0 File Offset: 0x003323E0
		public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)
		{
			int num = this.Type;
			if (num != 1)
			{
				if (num == 2)
				{
					this.unpivotInClause.doParse(psql, plocation);
				}
			}
			else
			{
				if (this.aggregation_function_list != null)
				{
					this.aggregation_function_list.doParse(psql, plocation);
				}
				else if (this.aggregation_function != null)
				{
					this.aggregation_function.doParse(psql, plocation);
				}
				this.pivotInClause.doParse(psql, plocation);
			}
			if (this.AliasClause != null)
			{
				this.AliasClause.doParse(psql, plocation);
			}
		}

		// Token: 0x060021BC RID: 8636 RVA: 0x0033425B File Offset: 0x0033245B
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x060021BD RID: 8637 RVA: 0x0033426C File Offset: 0x0033246C
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			int num = this.Type;
			if (num != 1)
			{
				if (num == 2)
				{
					this.valueColumnList.acceptChildren(v);
					this.pivotColumnList.acceptChildren(v);
					this.unpivotInClause.acceptChildren(v);
				}
			}
			else
			{
				if (this.aggregation_function_list != null)
				{
					this.aggregation_function_list.acceptChildren(v);
				}
				else if (this.aggregation_function != null)
				{
					this.aggregation_function.acceptChildren(v);
				}
				this.pivotColumnList.acceptChildren(v);
				if (this.pivotInClause != null)
				{
					this.pivotInClause.acceptChildren(v);
				}
			}
			if (this.AliasClause != null)
			{
				this.AliasClause.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x04001AB1 RID: 6833
		public const int pivot = 1;

		// Token: 0x04001AB2 RID: 6834
		public const int unpivot = 2;

		// Token: 0x04001AB3 RID: 6835
		private int type = 1;

		// Token: 0x04001AB4 RID: 6836
		private TPivotInClause pivotInClause;

		// Token: 0x04001AB5 RID: 6837
		private TUnpivotInClause unpivotInClause;

		// Token: 0x04001AB6 RID: 6838
		private TResultColumnList aggregation_function_list;

		// Token: 0x04001AB7 RID: 6839
		private TResultColumnList in_result_list;

		// Token: 0x04001AB8 RID: 6840
		private TObjectNameList pivotColumnList;

		// Token: 0x04001AB9 RID: 6841
		private TFunctionCall aggregation_function;

		// Token: 0x04001ABA RID: 6842
		private TObjectName valueColumn;

		// Token: 0x04001ABB RID: 6843
		private TObjectNameList valueColumnList;

		// Token: 0x04001ABC RID: 6844
		private TObjectName pivotColumn;

		// Token: 0x04001ABD RID: 6845
		private TObjectNameList columnList;
	}
}
